ra, dec, number  = [], [], []
for line in open('res.txt', 'r'):
    values = [s for s in line.split()]
    number.append(float(values[0]))
    ra.append(float(values[1]))
    dec.append(float(values[2]))



import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure()
ax3 = plt.axes(projection='3d')

plt.rcParams['font.sans-serif']=['FangSong'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False # 用来正常显示负号

X, Y = np.meshgrid(ra, dec)
#作图
#ax3.plot_surface(X, Y, number,cmap='rainbow')
# 改变cmap参数可以控制三维曲面的颜色组合, 一般我们见到的三维曲面就是 rainbow 的
plt.scatter(ra, dec, number)
plt.show()